﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageAdmin.master" AutoEventWireup="true"
    CodeFile="User.aspx.cs" Inherits="Private_User" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
//                //function rpass
//                function checkRePass() {
//                    var x = document.forms["Form1"]["txtUserName"].value;
//                    var y = document.forms["Form1"]["txtRePass"].value
//                    
//                    if (x != y) {
//                        document.getElementById("ErrorPass").style.display = "block"; // hien thi loi erro3
//                    } else {
//                        document.getElementById("ErrorPass").style.display = "none"; // an loi erro3
//                    }
//                }
    </script>
    <style type="text/css">
        .style1
        {
            text-align: right;
            color: #FFFFFF;
            font-weight: bold;
            width: 116px;
        }
        .style2
        {
            width: 116px;
        }
        
        .style6
        {
            text-align: right;
            width: 112px;
        }
        .style7
        {
            width: 266px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <form id="Form1" method="post" runat="server">
    <div class="CSSTableGenerator">
        <table style="width: 100%;">
            <tr>
                <td class="style6">
                    User Name :
                </td>
                <td class="style7">
                    <asp:TextBox ID="txtUserName" runat="server" Width="250px"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUserName"
                        ErrorMessage="RequiredFieldValidator" ForeColor="Red" ValidationGroup="CheckNull">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    Passwords :
                </td>
                <td>
                    <asp:TextBox ID="txtPasswords" runat="server" TextMode="Password" Width="250px"></asp:TextBox>
                </td>
                <td>
                    <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPasswords"
                        ErrorMessage="RequiredFieldValidator" ForeColor="Red" ValidationGroup="CheckNull">*</asp:RequiredFieldValidator>--%>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    Re-Passwords :
                </td>
                <td>
                    <asp:TextBox ID="txtRePass" runat="server" TextMode="Password" Width="250px"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="lblErrorPass" runat="server" Text="" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Email:
                </td>
                <td>
                    <asp:TextBox ID="txtEmail" runat="server" Width="250px"></asp:TextBox>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtEmail"
                        ErrorMessage="RegularExpressionValidator" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        ForeColor="Red" ValidationGroup="CheckNull">*</asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Phone:
                </td>
                <td>
                    <asp:TextBox ID="txtPhone" runat="server" Width="250px"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtPhone"
                        ErrorMessage="RequiredFieldValidator" ForeColor="Red" ValidationGroup="CheckNull">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Level:
                </td>
                <td>
                    <asp:DropDownList ID="ddlLevel" runat="server" Width="250px">
                        <asp:ListItem Value="0">Admin</asp:ListItem>
                        <asp:ListItem Value="1">Customer</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Block:
                </td>
                <td>
                    <asp:CheckBox ID="ckbBlock" runat="server" Checked="true" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style1">
                    FullName:
                </td>
                <td>
                    <asp:TextBox ID="txtFullName" runat="server" Width="250px"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFullName"
                        ErrorMessage="RequiredFieldValidator" ForeColor="Red" ValidationGroup="CheckNull">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Address:
                </td>
                <td>
                    <asp:TextBox ID="txtAddress" runat="server" Width="250px"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Identitycard:
                </td>
                <td>
                    <asp:TextBox ID="txtIdentitycard" runat="server" Width="250px"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtIdentitycard"
                        ErrorMessage="RequiredFieldValidator" ForeColor="Red" ValidationGroup="CheckNull">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Descriptions:
                </td>
                <td>
                    <asp:TextBox ID="txtDescriptions" runat="server" Width="250px"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                    <asp:Button ID="btnAdd" runat="server" Text="Save" Width="61px" OnClick="btnAdd_Click"
                        ValidationGroup="CheckNull" />&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnUpdate" runat="server" Text="Update" 
                        ValidationGroup="CheckNull" onclick="btnUpdate_Click" />
                &nbsp;&nbsp;
                    <asp:Button ID="btnClearText" runat="server" onclick="btnClearText_Click" 
                        Text="ClearText" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
    <div class="CSSTableGenerator">
        <asp:GridView ID="GridViewUsers" runat="server" AutoGenerateColumns="false" 
            DataKeyNames="UserID" onrowcommand="GridViewUsers_RowCommand">
            <Columns>
                <asp:TemplateField HeaderText="User ID">
                    <ItemTemplate>
                        <%# Eval("UserID")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="User Name">
                    <ItemTemplate>
                        <%# Eval("Username")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Email">
                    <ItemTemplate>
                        <%# Eval("email")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Phone">
                    <ItemTemplate>
                        <%# Eval("phone")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="FullName">
                    <ItemTemplate>
                        <%# Eval("fullname")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Address">
                    <ItemTemplate>
                        <%# Eval("address")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Identitycard">
                    <ItemTemplate>
                        <%# Eval("identitycard")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtnView" runat="server" CausesValidation="False" CommandName="View"
                            Width="50" Text="View" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>'>
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    </form>
</asp:Content>
